package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ForUserMapper;
import com.ruoyi.system.domain.ForUser;
import com.ruoyi.system.service.IForUserService;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-21
 */
@Service
public class ForUserServiceImpl implements IForUserService 
{
    @Autowired
    private ForUserMapper forUserMapper;

    /**
     * 查询用户
     * 
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public ForUser selectForUserById(Long id)
    {
        return forUserMapper.selectForUserById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param forUser 用户
     * @return 用户
     */
    @Override
    public List<ForUser> selectForUserList(ForUser forUser)
    {
        return forUserMapper.selectForUserList(forUser);
    }

    /**
     * 新增用户
     * 
     * @param forUser 用户
     * @return 结果
     */
    @Override
    public int insertForUser(ForUser forUser)
    {
        forUser.setCreateTime(DateUtils.getNowDate());
        return forUserMapper.insertForUser(forUser);
    }

    /**
     * 修改用户
     * 
     * @param forUser 用户
     * @return 结果
     */
    @Override
    public int updateForUser(ForUser forUser)
    {
        forUser.setUpdateTime(DateUtils.getNowDate());
        return forUserMapper.updateForUser(forUser);
    }

    /**
     * 批量删除用户
     * 
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteForUserByIds(Long[] ids)
    {
        return forUserMapper.deleteForUserByIds(ids);
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteForUserById(Long id)
    {
        return forUserMapper.deleteForUserById(id);
    }
}
